package com.runfast.waimai.dao.mapper;

import com.runfast.common.dao.IMapper;
import com.runfast.waimai.dao.model.RunfastBusiness;
import com.runfast.waimai.dao.model.RunfastBusinessExample;
import com.runfast.waimai.web.dto.BusinessDto;
import org.apache.ibatis.annotations.Mapper;

import org.apache.ibatis.annotations.Param;

import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;


import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface RunfastBusinessMapper extends IMapper<RunfastBusiness, Integer, RunfastBusinessExample> {
    List<BusinessDto> nearBy(@Param("agentId") Integer agentId, @Param("distance") Integer distance, @Param("longitude") Double longitude, @Param("latitude") Double latitude, @Param("sorting") Integer sorting, @Param("activityType") Integer activityType, @Param("catalogId") Integer catalogId, @Param("pageable") Pageable pageable);

    BusinessDto detailWithDistance(@Param("businessId") Integer businessId, @Param("longitude") Double longitude, @Param("latitude") Double latitude);
   List<RunfastBusiness> findByAgentnameAndbusinessnameAndTime(@Param("agentid") Integer agentid, @Param("name") String name, @Param("createtime1") Date createtime1, @Param("createtime2") Date createtime2);


    List<BusinessDto> search(String name, Integer agentId, Double userLng, Double userLat, Pageable pageable);


    List<Map<String, Object>> getAgentZoneBusiness(Integer agentId, List<Integer> activityTypeList, Pageable pageable);

    List<BusinessDto> listBusiness(List<Integer> businessIdList, Double userLng, Double userLat);
}